{include file="public/public"}
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                </fieldset>
                <span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
                <hr>

            </div>
        </div>
    </div>
</div>
<SCRIPT language="javascript"> 
<!--
//选中
function bok() {
	
	
	var i=0;
	var rtstr="";
	if(document.selform.selRoom[0]==null)
	{rtstr=document.selform.selRoom.value;}
	else
	{
		for (var i=0;i<document.selform.selRoom.length;i++) {
			var e=document.selform.selRoom[i];
			if(e.checked)
			{
				rtstr=rtstr+"|"+e.value;
			}
		}
	}
	if(rtstr==""){
		alert('请选择房间');
		return;
	}
	$("#nroom").val(rtstr);
	$("#show_kaifang").show();
	/*window.returnValue =rtstr;
	window.close();*/
	//alert(pos);
}
function cancel_kaifang(){
	$("#show_kaifang").hide();
}
function selIt(box)
{
	if(document.activeElement.innerText!=''){
		if(document.selform.selRoom[0]==null)
		{document.selform.selRoom.checked=!document.selform.selRoom.checked;}
		else
		{
			for (var i=0;i<document.selform.selRoom.length;i++) {
				var e=document.selform.selRoom[i];
				//alert(box.innerText);
				if(e.value.indexOf(box.innerText)>0)
				{
					e.checked=!e.checked;
				}
			}
		}
	}
}

function SelectAllTmp() {
	for (var i=0;i<document.selform.selRoom.length;i++) {
		var e=document.selform.selRoom[i];
		if(e.className=="rtmp")
			e.checked=!e.checked;
	}
}
function SelectAllOk() {
	for (var i=0;i<document.selform.selRoom.length;i++) {
		var e=document.selform.selRoom[i];
		if(e.className!="rtmp")
			e.checked=!e.checked;
	}
}



function SelectAll(o) {
	if( $("input:checked").length<1){
		$("input[name='selRoom']").attr("checked",true);
	}else{
		$("input[name='selRoom']").attr("checked",false);
	}

} 

//-->

//选择房间
function batchs()
{
var a;
a=window.showModalDialog("selectroomAll.html","","dialogWidth:730px;dialogHeight:600px;scroll:yes;status:no");
if(a!=undefined)
	{
		$("#nroom").val(a);
	}
}

function submit1(){
	var name = $("#name").val();
	var chenghu = $("#chenghu").val();
	var pid = $("#pid").val();
	var nroom = $("#nroom").val();
	var time = $("#time").val();
	var indexpage = $("#indexpage").val();
	var language = $("#language").val();
	var level = $("#level").val();
	var team = $("#team").val();
	if(name==''){
		alert('请填写客人名称');
		return false;
	}
	if(nroom==''){
		alert('请选择房间');
		return false;
	}
	$.post("__APP__/admin/kaifang",{
		name : name,
		chenghu : chenghu,
		pid : pid,
		nroom : nroom,
		time : time,
		indexpage : indexpage,
		language : language,
		level : level,
		team : team
	}, function(data) {
		if(data.msg=="1"){
			alert("添加成功");
			
			location.href="__APP__/admin/ssft";
		}else if(data.msg=="2"){
			alert("房间已有客人入住");
		}else{
			alert("添加失败");
		}
	},"json");
	$("#inputright").show();
	$("#inputwrong").hide();
	
}


//响应单击事件
function myclick()
{
	if(checkIdcard('pid'))
	{
		$("#inputright").show();
		$("#inputwrong").hide();
	}
	else
	{
		$("#inputwrong").show();
		$("#inputright").hide();
	}
}

function subsou(){
    var hotelname = $("#hotelname").val();
    var filmname = $("#filmname").val();
    var roomid=$("#roomid").val();

    window.location.href='__APP__/admin/admin_index?hotelname='+hotelname+"&filmname="+filmname+"&roomid="+roomid;

}
function edit(val,flag){
    var json=JSON.parse(val);
    var stime=json.stime;

    stime=new Date(parseInt(stime) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");

    $("#id").val(json.id);
    $("#ordernum").html(json.ordernum);
    $("#hotelName1").html(json.hotelName);
    $("#hotel").html(json.hotel);
    $("#roomNo").html(json.roomNo);
    $("#guestName").html(json.guestName);
    $("#Tel").html(json.Tel);
    $("#account").html(json.account);
    $("#filename").html(json.filename);
    $("#price").html(json.price);
    $("#stime").html(stime);

    $("#show").show();
}

</SCRIPT>
</head>
<body>
{include file="public/head"}

</div>
<div class="content_2 clear">
{include file="admin/left"}
<div class="content_3 left" >
  <div class="content_3_wz"><img src="__PUBLIC__/images/dajt.png" />系统管理 &gt; 电影账单</div>
  
  <div class="content_3_fdj"><img src="__PUBLIC__/images/fdj.jpg" /></div>
  <div class="content_3_ss clear">
      <ul>

          <li><span class="ctt_wd left">酒店名：</span>
              <input name="text" type="text" class="layui-input" id="hotelname" size="8"/>
          </li>
          <li><span class="ctt_wd left">房间号：</span>
              <input name="text" type="text" class="layui-input" id="roomid"size="8"/>
          </li>
          <li><span class="ctt_wd left">电影名：</span>
              <input name="text" type="text" class="layui-input" id="filmname"size="8"/>
          </li>
          <li class="ss_cx"><a href="#"  onClick="subsou()">查询</a></li>
      </ul>

  </div>

      <table class="layui-table" lay-skin="line" >
       <thead >
        <tr>
            <td width="51" >选择</td>
            <td width="70">订单号</td>
            <td width="110">酒店名</td>
            <td width="87" >房间号</td>
            <td width="87" >客人名</td>
            <td width="180">电影名</td>
            <td width="187" >时间</td>
            <td width="49" >价格</td>
            <td width="49" >操作</td>

        </tr>
        </thead>
        <tbody>
        <?
      if($krhjArr){
      	foreach($krhjArr as $val){
      	 $tmp = addslashes(json_encode($val));
     	 $stime=date("Y-m-d H:i:s",$val['stime']);

   ?>
        <tr class="ctt_white">
            <td><input  type="checkbox" name="contentbox" id="contentbox"  value="{$val[id]}"></td>
            <td>{$val[ordernum]}</td>
            <td>{$val[hotel]}</td>
            <td>{$val[roomNo]}</td>
            <td>{$val[guestName]}</td>
            <td>{$val[filename]}</td>
            <td>{$stime}</td>
            <td>{$val[price]}</td>
            <td> <a href="#" class="layui-btn layui-btn-sm" onclick='edit("{$tmp}",2)'>查看 </a></td>

        </tr>
        <?php
		 }
	  }?>
        </tbody>
    </table>

    <div id="show" style="DISPLAY:none" class="show">
        <table class="layui-table" lay-skin="line">
           <thead >
            <tr>
                <td colspan="4">账单详情</td>
                <input type="hidden" id="id" name="id">

            </tr>
            </thead>
            <tbody>
            <tr class="ctt_gr">
                <td width="244" align="right">酒店名：</td>
                <td width="248" align="left"><div id="hotel" name="hotel"></div>
                    <!--<input class="textField_hp1"  size="20" id="hotel" name="hotel"/>-->
                </td>
                <td width="244" align="right">房间号：</td>
                <td width="248" align="left"><div id="roomNo" name="roomNo"></div></td>
            </tr>
            <tr class="ctt_gr">
                <td width="244" align="right">订单号：</td>
                <td width="248" align="left"><div id="ordernum" name="ordernum"></div>
                    <!--<input class="textField_hp1"  size="20" id="hotel" name="hotel"/>-->
                </td>
                <td width="244" align="right">时间：</td>
                <td width="248" align="left"><div id="stime" name="price" ></div></td>
            </tr>
            <tr class="ctt_gr">
                <td width="244" align="right">电影名：</td>
                <td width="248" align="left"><div id="filename" name="filename"></div>
                    <!--<input class="textField_hp1"  size="20" id="hotel" name="hotel"/>-->
                </td>
                <td width="244" align="right">价格：</td>
                <td width="248" align="left"><div id="price" name="price"></div></td>
            </tr>

            <tr class="ctt_gr">
                <td width="244" align="right">客人：</td>
                <td width="248" align="left"><div id="guestName" name="guestName"></div>
                    <!--<input class="textField_hp1"  size="20" id="hotel" name="hotel"/>-->
                </td>
                <td width="244" align="right">电话：</td>
                <td width="248" align="left"><div id="Tel" name="Tel"></div></td>
            </tr>
            <tr class="ctt_gr">
                <td width="244" align="right">账户：</td>
                <td width="248" align="left"><div id="account" name="account"></div>
                    <!--<input class="textField_hp1"  size="20" id="hotel" name="hotel"/>-->
                </td>
                <!--<td width="244" align="right">价格：</td>-->
                <!--<td width="248" align="left"><div id="price" name="price"></div></td>-->
            </tr>

            <tr class="ctt_gr">
                <td height="31" colspan="4" align="center">
                    <input name="submit22" type="button" value="关闭" border="0" onclick="document.getElementById
	('show').style.display='none'" class="layui-btn layui-btn-warm"/></td>
            </tr>
            </tbody>
        </table>

    </div>
    <div class="content_1234" >
        <div class="layui-box layui-laypage layui-laypage-default">{$page}</div>
    </div>
 </div>
</div>
</body>
</html>
